package com.kaiwukj.android.ufamily.mvp.ui.page.service.order;

import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.blankj.utilcode.util.StringUtils;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.app.base.review.BaseActivity;
import com.kaiwukj.android.ufamily.app.constant.ARouterUrlKt;

import butterknife.BindView;
import butterknife.OnClick;

@Route(path = ARouterUrlKt.OrderRemarksUrl)
public class OrderRemarksActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.et_remarks)
    EditText etRemarks;

    @OnClick(R.id.container_left)
    void onBackClick() {
        onBackPressedSupport();
    }

    @OnClick(R.id.btn_confirm)
    void onConfirm() {
        String content = etRemarks.getText().toString().trim();
        if (StringUtils.isEmpty(content)) {
            showMessage("内容不能为空!");
            return;
        }

        Intent data = new Intent();
        data.putExtra("remarks", content);
        setResult(RESULT_OK, data);
        finish();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_order_remarks;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        tvTitle.setText("订单备注");
    }

    @Override
    protected void initData(Bundle savedInstanceState) {

    }
}
